package partner_admin_roles

import (
	"gitee.com/theegg/go-brick/app/model/partner/partner_admin/partner_admin_permissions"
	"time"
)

// 表名也是cache的tag
var TableName = "partner_admin_roles"

// @title PartnerAdminRoles
// @description 管理员角色
type PartnerAdminRoles struct {
	Id   int64  `xorm:"pk autoincr"`
	Pid  int64  `xorm:"integer(11) null default(0) 'pid'"`
	Rid  string `xorm:"varchar(128) notnull 'rid'"`
	Name string `xorm:"varchar(64) notnull 'name'"`

	AddUserId int64  `xorm:"integer(11) notnull 'add_user_id'"`
	AddUserIp string `xorm:"char(15) notnull 'add_user_ip'"`

	Mark string `xorm:"varchar(128) null 'mark'"`

	Status int `xorm:"tinyint notnull default(0) 'status'"`

	CreatedAt time.Time `xorm:"notnull created 'created_at'"`
	UpdatedAt time.Time `xorm:"null updated 'updated_at'"`

	// 不参与
	permissions map[int64]*partner_admin_permissions.PartnerAdminPermissions `xorm:"-"`
}
